Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ng-html2js

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-html2js

Standalone script to turn Angular template into js and put it in a module.

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.6K
decreased by-34.08%
Maintainers
1
Weekly downloads
 
Created
Source

ng-html2js Analytics

Build Status Dependency Status

Standalone script to turn Angular template into js and put it in a module.

Usage

$ ng-html2js inputFile [outputFile] [-m moduleName] [--module-var ngModule]

If you specify only inputFile, it will display the result to the console.

If you don't specify moduleName, inputFile will be the name of the module.

$ ng-html2js test/test.tmpl
var module = angular.module('test/test.tmpl', []);
module.run(['$templateCache', function($templateCache) {
  $templateCache.put('test/test.tmpl',
    '<div>\n' +
    '  hello world\n' +
    '  <div ng-repeat="item in items">\n' +
    '    {{ item }} it\'s value is great\n' +
    '  </div>\n' +
    '</div>\n' +
    '');
}]);

If you specify moduleName, the template will belong to that module.

$ ng-html2js test/test.tmpl -m foo --module-var ngModule
var ngModule;
try {
  ngModule = angular.module('foo');
} catch (e) {
  ngModule = angular.module('foo', []);
}

ngModule.run(['$templateCache', function ($templateCache) {
  $templateCache.put('test/test.tmpl',
    '<div>\n' +
    '  hello world\n' +
    '  <div ng-repeat="item in items">\n' +
    '    {{ item }} it\'s value is great\n' +
    '  </div>\n' +
    '</div>\n' +
    '');
}]);

License

This seed is released under permissive MIT License.

Keywords

FAQs

Package last updated on 12 Nov 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc